package com.itcam.api.client;

import com.itcam.api.client.fallback.PayClientFallback;
import com.itcam.api.dto.PayOrderDTO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

@FeignClient(value = "pay-service", fallbackFactory = PayClientFallback.class)
public interface PayClient {

    /**
     * 根据交易订单id查询支付单
     *
     * @param id 业务订单id
     * @return 支付单信息
     */
    @ApiOperation("根据交易订单id查询支付单")
    @GetMapping("/pay-orders/biz/{id}")
    PayOrderDTO queryPayOrderByBizOrderNo(@PathVariable("id") Long id);


    /**
     * 修改支付单状态
     *
     * @param orderId
     * @param status
     */
    @ApiOperation("修改支付单状态")
    @PutMapping("/status/{id}/{status}")
    void updatePayOrderByBizOrderNo(@PathVariable("id") Long orderId,
                                    @PathVariable("status") Integer status);

}